package com.xy.hms.service.imp;

import com.xy.hms.mapper.OrderMapper;
import com.xy.hms.model.RoomOrder;
import com.xy.hms.service.OrderServiceI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author xiaye
 * @create 2020-04-29-12:04
 */
@Service
public class OrderServiceImp implements OrderServiceI {
    @Autowired
    OrderMapper orderMapper;

    @Override
    public List<RoomOrder> selectAllOrders() {
        List<RoomOrder> roomOrders = orderMapper.selectAllOrders();
        return roomOrders;
    }

    @Override
    public int addOrder(RoomOrder order) {
        int i = orderMapper.addOrder(order);
        return i;
    }

    @Override
    public RoomOrder selectOrderById(Integer id) {
        RoomOrder roomOrder = orderMapper.selectOrderByID(id);
        return roomOrder;
    }

    @Override
    public int updateOrder(RoomOrder roomOrder) {
        int i = orderMapper.updateOrder(roomOrder);
        return i;
    }
}
